<?
/**
 * Confirm before deleting a user id
 */
(basename($_SERVER['PHP_SELF']) == basename(__FILE__)) && die('Access Denied');

// title
$this->setTitle(WEB_APP_NAME . ' : ' . OPT_DEL . ' Confirmation');

/**
 * Validate db object
 */
$item =& $this->getVar('item');
if (!($item instanceof User)) {
	die('FATAL ERROR: no object');
	}

/**
 * Are there errors?
 */
$hasErrors = (is_array($this->getErrors()) and count($this->getErrors()));

/**
 * Delete link
 */
$qs_del = $this->getActionQs(ACTION_DEL) . '&' . WA_QS_CONFIRM . '=yes';
$canDel = ($item->canDelete() && (getUserId() !== $item->Id()));

$this->addJs('js/menu.js');
?>
<?= $this->getPageHeader(); ?>
<? if ($hasErrors) { ?>
<div id="container-error">
<?= implode('<br />', $this->getErrors()); ?>
</div>
<? } ?>
<div align="center">
<div id="page-container">

<div id="container-medium">
<?= getMenuBars(OPT_DEL, $canDel); ?>
</div> <!-- container-medium -->

<div id="container-small">
<div class="content-view">
<p align="center">
	Are you certain you want to delete: <?= $item->Description(); ?>?
</p>
<p align="center">
	<a href="<?= $qs_del; ?>">CONFIRM DELETE</a>
</p>
</div> <!-- content-view -->

</div> <!-- container-small -->
</div> <!-- page-container -->
</div> <!-- center -->
<script type="text/javascript">
doMenuMsg('<?= OPT_DEL; ?>');
</script>
<?= $this->getPageFooter(); ?>
